export default function deepClone(target) {
  let newObj = target.constructor === Array ? [] : {};
  for (let attr in target) {
    if (target.hasOwnProperty(attr)) {
      if (typeof target[attr] === "object") {
        newObj[attr] = deepClone(target[attr]);
      } else {
        newObj[attr] = target[attr];
      }
    }
  }
  return newObj;
}